package com.dddd.blog.blogcommon.constant;

import lombok.Getter;

/**
 * @author 喵星球的大橘
 * @version 1.0
 * 响应码枚举
 */
@SuppressWarnings("all")
@Getter
public enum  ResultCode {

    //通用响应

    SUCCESS(200,"请求成功"),

    FAIL(400, "请求失败"),

    NOT_FOUND(404, "请求未找到"),

    BAD_REQUEST(400, "错误的请求"),

    UNAUTHORIED(401, "认证失败"),

    METHOD_NOT_ALLOWED(405, "方法不被允许"),

    INTERNAL_ERROR(500, "服务器内部错误"),

    // 自定义响应

    PARAMS_INVLIDA(1000, "参数无效"),

    PARAMS_BLANK(1001, "参数为空"),

    OBJECT_NOT_EXIST(1002,"用户不存在"),

    PASSWORD_INCORRECT(1003,"密码错误");

    /**
     * 响应状态码
     */
    private int code;
    /**
     * 响应消息
     */
    private String msg;

    private ResultCode(int code, String msg){
        this.code = code;
        this.msg = msg;
    }

}
